deploy{
  final DeploymentUnit deploymentUnit=phaseContext.getDeploymentUnit();
      return;
 else   if (deploymentUnit.getParent() == null) {
      return;
 else {
      return;
  final DeploymentUnit topLevelDeployment=deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
  final ServicesAttachment services=deploymentUnit.getAttachment(Attachments.SERVICES);
  final Module module=deploymentUnit.getAttachment(Attachments.MODULE);
  ClassLoader oldCl=SecurityActions.getContextClassLoader();
  try {
    SecurityActions.setContextClassLoader(module.getClassLoader());
    loadAttachments(services,module,deploymentUnit,topLevelDeployment);
  finally {
    SecurityActions.setContextClassLoader(oldCl);
}
loadAttachments{
  final DeploymentReflectionIndex index=deploymentUnit.getAttachment(Attachments.REFLECTION_INDEX);
  final List<String> services=servicesAttachment.getServiceImplementations(Extension.class.getName());
  if (services == null) {
  for (  String service : services) {
    final Extension extension=loadExtension(service,index,module.getClassLoader());
    if (extension == null) {
      continue;
    Metadata<Extension> metadata=new MetadataImpl<Extension>(extension,deploymentUnit.getName());
}
loadExtension{
  Class<?> clazz;
  Class<Extension> serviceClass;
  try {
    clazz=loader.loadClass(serviceClassName);
    serviceClass=(Class<Extension>)clazz;
    final Constructor<Extension> ctor=index.getClassIndex(serviceClass).getConstructor(EMPTY_STRING_ARRAY);
    return ctor.newInstance();
 catch (  ClassCastException e) {
}
undeploy{ }
